<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the command's operation ID</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongodb-driver-monitoring-commandstartedevent.getdatabasename.html">« MongoDB\Driver\Monitoring\CommandStartedEvent::getDatabaseName</a></li>
      <li style="float: right;"><a href="mongodb-driver-monitoring-commandstartedevent.getrequestid.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongodb-driver-monitoring-commandstartedevent.html">MongoDB\Driver\Monitoring\CommandStartedEvent</a></li>
    <li>Returns the command's operation ID</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongodb-driver-monitoring-commandstartedevent.getoperationid" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId</h1>
  <p class="verinfo">(mongodb &gt;=1.3.0)</p><p class="refpurpose"><span class="refname">MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId</span> &mdash; <span class="dc-title">Returns the command&#039;s operation ID</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-driver-monitoring-commandstartedevent.getoperationid-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId</strong></span>(): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   The operation ID is generated by the driver and may be used to link events
   together such as bulk write operations, which may have been split across
   several commands at the protocol level.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <span class="simpara">
    Since multiple commands may share the same operation ID, it is not reliable
    to use this value to associate event objects with each other. The request ID
    returned by
    <span class="methodname"><a href="mongodb-driver-monitoring-commandstartedevent.getrequestid.html" class="methodname">MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId()</a></span>
    should be used instead.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-driver-monitoring-commandstartedevent.getoperationid-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-driver-monitoring-commandstartedevent.getoperationid-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the command&#039;s operation ID.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-driver-monitoring-commandstartedevent.getoperationid-errors">
  <h3 class="title">错误／异常</h3>
  <ul class="simplelist">
   <li class="member">Throws <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.html" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> on argument parsing errors.</li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-driver-monitoring-commandstartedevent.getoperationid-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="mongodb-driver-monitoring-commandfailedevent.getoperationid.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Monitoring\CommandFailedEvent::getOperationId()</a> - Returns the command's operation ID</span></li>
   <li class="member"><span class="methodname"><a href="mongodb-driver-monitoring-commandsucceededevent.getoperationid.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Monitoring\CommandSucceededEvent::getOperationId()</a> - Returns the command's operation ID</span></li>
   <li class="member"><span class="methodname"><a href="mongodb-driver-monitoring-commandstartedevent.getrequestid.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId()</a> - Returns the command's request ID</span></li>
   <li class="member"><a href="mongodb.tutorial.apm.html" class="xref">Application Performance Monitoring (APM)</a></li>
  </ul>
 </div>


</div></div></div></body></html>